Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cdp): activity logs #25253

Merged
merged 41 commits into from
Oct 15, 2024
Merged

feat(cdp): activity logs #25253

merged 41 commits into from
Oct 15, 2024

Conversation

mariusandra
Copy link
Collaborator

@mariusandra mariusandra commented Sep 27, 2024

Problem

We want to track activity logs for hog functions (destinations).

Turns out activity logs are in the middle of a migration. We have one ActivityLog model that collects all the data, yet until now most logs were accessed via urls like .../feature_flags/1/activity. Since I'd like to show both "app/plugin" and "hog function" logs in the same list, I needed to use the common endpoint.

Changes

  • Refactor plugins/activity_logs to also use the common activity log endpoint
  • Add an option to get the activity log for more than one type of activity
  • Add page number pagination to the general endpoint to make it compatible with existing frontend code (API users can continue using cursor-based)
  • Refactor one inconsistent name in the frontend (total_count -> count)
  • Adds activity logs tracking for hog functions
  • Adds a monaco-based diff viewer for changes in the frontend
  • Adds a history tab to destinations
  • Adds destination logs to the global data pipeline history tab

How did you test this code?

Backend tests. Made sure the pagination worked. Clicked around in the interface.

2024-10-15 14 47 23

Copy link
Contributor

github-actions bot commented Sep 27, 2024

Size Change: +216 B (+0.02%)

Total Size: 1.14 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.14 MB +216 B (+0.02%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

  • chromium: 0 added, 3 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@mariusandra mariusandra marked this pull request as ready for review October 15, 2024 12:54
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@oliverb123 oliverb123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sick, nice work. Should we add something to the docs calling out the diff viewer in function history? It's effectively function versioning, which I think is a big deal for hog usability, but it's a little hidden right now (you can't view it while editing a function, for example).

@mariusandra
Copy link
Collaborator Author

mariusandra commented Oct 15, 2024

Technically you can view it if you open it in a new tab 🙃... That said, yeah, now that we are collecting the data, we can start to show it in other places as well. We could even put a little hourglass next to each input field, and show its individual changes in a popover. Docs could get an upgrade too.

One place where I'd really like to add the diff viewer is upgrades --> what'll change if I upgrade my template to the new version. The old apps/plugins actually had something similar (link to a github diff if a new version is available).

But let's get this chunk of work in first 😅

@mariusandra mariusandra merged commit 71ac3fe into master Oct 15, 2024
93 checks passed
@mariusandra mariusandra deleted the hog-activity-log branch October 15, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants